﻿using System;
using Teigha.Core;

namespace OdaOperation.Core.Simplifier
{
    internal class SimplifierVectorizeView : OdGsBaseVectorizeView
    {
        private SimplifierVectorizer m_vectorizer;

        private SimpliferVectorizeDevice m_device;

        internal void SetVectorizer(SimplifierVectorizer simplifierVectorizer)
        {
            this.m_vectorizer = simplifierVectorizer;
        }

        internal void SetDevice(SimpliferVectorizeDevice simpliferVectorizeDevice)
        {
            this.m_device = simpliferVectorizeDevice;
        }

        protected override OdGsBaseVectorizer getVectorizer(bool bDisplay)
        {
            return this.m_vectorizer;
        }

        public override OdGsDevice device()
        {
            return this.m_device;
        }

        public void ownerDrawDc(OdGePoint3d origin, OdGeVector3d u, OdGeVector3d v, OdGiSelfGdiDrawable pDrawable, bool dcAligned, bool allowClipping)
        {
            MemoryTransaction value = MemoryManager.GetMemoryManager().StartTransaction();
            OdGeMatrix3d matrix = this.m_vectorizer.eyeToOutputTransform();
            OdGePoint3d odGePoint3d = new OdGePoint3d(matrix * origin);
            OdGeVector3d odGeVector3d = new OdGeVector3d(matrix * u);
            OdGeVector3d odGeVector3d2 = new OdGeVector3d(matrix * v);
            MemoryManager.GetMemoryManager().StopTransaction(value);
        }

        protected override void releaseVectorizer(OdGsBaseVectorizer pVect)
        {
        }
    }
}
